import request from '@/config/axios'

// 分选机 VO
export interface SeparatorVO {
  id: number // id
  deviceId: string // 设备编号
  name: string // 设备名称
  description: string // 描述
  status: number // 状态
}

// 分选机 API
export const SeparatorApi = {
  // 查询分选机分页
  getSeparatorPage: async (params: any) => {
    return await request.get({ url: `/farm/separator/page`, params })
  },

  // 查询分选机详情
  getSeparator: async (id: number) => {
    return await request.get({ url: `/farm/separator/get?id=` + id })
  },

  // 新增分选机
  createSeparator: async (data: SeparatorVO) => {
    return await request.post({ url: `/farm/separator/create`, data })
  },

  // 修改分选机
  updateSeparator: async (data: SeparatorVO) => {
    return await request.put({ url: `/farm/separator/update`, data })
  },

  // 删除分选机
  deleteSeparator: async (id: number) => {
    return await request.delete({ url: `/farm/separator/delete?id=` + id })
  },

  // 导出分选机 Excel
  exportSeparator: async (params) => {
    return await request.download({ url: `/farm/separator/export-excel`, params })
  },
}